package com.bm.specialvehiclefordispatcher.Tools;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import android.widget.TextView;

public class Tools {

	public static String getTextViewText(TextView textView) {

		return textView.getText().toString().trim();
	}

	public static boolean validatePhone(String phone) {
		Pattern p = Pattern
				.compile("^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$");
		Matcher matcher = p.matcher(phone);
		return matcher.matches();
	}

}
